# -*- coding: utf-8 -*-#
#-------------------------------------------------------------------------------
# 建立者:        潘炎珍  
# Name:         demo18
# Description:
# Author:       98745
# Date:         2019/6/10
#-------------------------------------------------------------------------------

from flask import Flask,render_template,request
from flask_wtf import FlaskForm
from wtforms import *

app=Flask(__name__)
app.secret_key='panyznzhen123456'

class ContactForm(FlaskForm):
    name=TextField('姓名',[validators.Required('姓名必须输入')])
    age=IntegerField('年龄',[validators.Required('必须输入年龄'),validators.NumberRange(10,30,'年龄必须在10到30')])
    birth=DateField('出生日期',[validators.Required('必须输入出生日期')])
    isStudent=BooleanField('是否为学生')
    resume=TextAreaField('简历',[validators.length(10,200,'简历长度必须在10，200个字')])
    submit=SubmitField('提交')

@app.route('/',methods=['GET','POST'])
def ConcatO():
    form=ContactForm()
    ok=Flask
    if request.method=='POST':
        if form.validate_on_submit()==False:
            print('error')
        else:
            print('输入成功')
            ok=True
    return render_template('simple.txt',form=form,ok=ok)

if __name__ == '__main__':
    app.run()